import Cookies from 'js-cookie'

const LoginKey = 'hasLogin'

export function getToken() {
  return Cookies.get(LoginKey);
}

// export function setToken() {
//   return Cookies.set(LoginKey, "1")
// }

export function setToken(token) {
 let seconds = 1800
 let expires = new Date(new Date() * 1 + seconds * 1000)
  return Cookies.set(LoginKey, token,{ expires: expires })
}
export function removeToken() {
  return Cookies.remove(LoginKey)
}
